<?php
	/**
	 * Elgg pel edit language
	 */
// Load Elgg engine
	require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
	gatekeeper();
	
// Allows the header to know wether or not to load the tabs.ui javascript
  global $pel_tabs;
  $pel_tabs = true;
	
// Get the current page's owner
	$page_owner = page_owner_entity();
	if ($page_owner === false || is_null($page_owner)){
		$page_owner = $_SESSION['user'];
		set_page_owner($_SESSION['guid']);
	}
	
// Get the post, if it exists
	$langguid =get_input("guid");
	if ($lang = get_entity($langguid)){
		if ($lang->canEdit()){
			$area2 = elgg_view_title(elgg_echo('pel:editlang'));
			$area2 .= elgg_view("pel/forms/editlang", array('entity' => $lang));
			$body = elgg_view_layout("two_column_left_sidebar", $area1, $area2);
		}
	}
// Display page
	page_draw(sprintf(elgg_echo('pel:editlang'),$lang->description),$body);	
?>